home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
bioinformatics.org
/
bioinformatics.org_software.tar
/
www.bioinformatics.org
/
download
/
ecell2
/
ecell220setup.exe
/
{app}
/
standard
/
STDR
/
DecayReactor.rd
< prev
next >
Wrap
Text File
|
2000-03-01
|
2KB
|
76 lines
@CLASSNAME: DecayReactor
@BASECLASS: FluxReactor
@AUTHOR: Kouichi Takahashi
@EMAIL: shafi@sfc.keio.ac.jp
@DATE: 29/6/1999
%VERSION: ecs-v08, 0.1
@BRIEF_DESCRIPTION: Disintegration or decay process.
@DESCRIPTION:A reactor class for disintegration or decay processes.
The quantity of the 'Substrate' is reduced according to the half-life inputted.
@EQUATION: $$S(t)=S(0)e^{-\frac{ln2}{T}t}$$
%SUBSTANCE: Substrate, 1, 1
%SUBSTANCE: Product, Inf, 0
%SUBSTANCE: Catalyst, 0, 0
%SUBSTANCE: Effector, 0, 0
%PARAMETER: T, Float, , Half Time
@NOTES: MassActionReactor: $k = \frac{ln2}{T}$
%INCLUDE_FILE_C: stdio.h
@PRIVATE:
Float k;
@INITIALIZE_FUNC:
if(T <= 0)
{
warning("0 or negative half time. set to 1."),condition(InitFail);
T = 1;
}
k = log(2)/T;
if(numSubstrate() != 1)
{
warning("the number of substrate of DecayReactor must be one.");
condition(InitFail);
}
for(int i = 0 ; i<numSubstrate() ; i++){
if(!substrate(i)->substance().haveConcentration())
{
char buf[50];
sprintf(buf,"Cannot calculate concentration of substrate [%s].",
substrate(i)->substance().entryname().c_str());
warning(buf),condition(InitFail);
}
}
@REACT_FUNC:
Float velocity = k * N_A;
velocity *= _substrateList[0]->substance().supersystem()->volume();
int i = numSubstrate();
do{
--i;
// calculate velocity
int j = substrate(i)->coefficient();
do{
j--;
velocity *= substrate(i)->concentration();
} while(j != 0);
} while(i != 0);
// now we have change in number of molecules per second
process(velocity);